package com.xiuxian.mapper;

import com.xiuxian.model.Video;
import com.xiuxian.model.dto.VideoDTO;
import com.xiuxian.model.vo.VideoVO;
import lombok.Data;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface VideoMapper {

    Video   getByid(Integer id);

    VideoDTO  getVideoByid(Integer id);

    List<Video>  find(@Param("title")String title,@Param("userId")Integer userId);

    List<Video>  findvo( VideoVO videoVO);

    List<Video> findmap(Map map);

    Map   findByid(Integer id);


    @Select("select  *  from jdbc_video   where  title  like  '%${title}%'")
    List<Video>  findbytitle(String title);


    VideoDTO  findwithcomment(Integer id);

    //动态sql
    List<Video>  getBytitle(String title);


    List<Video> getByUserId(Integer id);

    Integer  update(Video video);

    Integer  saveList(@Param("videoList") List<Video> videoList);

    //批量插入
    Integer  saveBatch(@Param("list") List<Video> list);
}
